//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.Icon;
import org.come.Jpanel.TeamPostMessageJpanel;
import org.come.until.CutButtonImage;
import org.come.until.MessagrFlagUntil;

public class TeamPostMessageListener implements MouseListener {
    private int type;
    private TeamPostMessageJpanel messageJpanel;
    private int num;

    public TeamPostMessageListener(int type, TeamPostMessageJpanel messageJpanel, int num) {
        this.type = type;
        this.messageJpanel = messageJpanel;
        this.num = num;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
    }

    @Override
    public void mousePressed(MouseEvent e) {
        int i;
        if (this.type == 1) {
            for(i = 0; i < this.messageJpanel.getLabArrRestrains().length; ++i) {
                if (i == this.num) {
                    if (this.messageJpanel.getLabArrRestrains()[i].getIcon() == null) {
                        this.messageJpanel.getLabArrRestrains()[i].setIcon(CutButtonImage.getImage("skin/8100226/button/B214.png", -1, -1));
                    }
                } else if (this.messageJpanel.getLabArrRestrains()[i].getIcon() != null) {
                    this.messageJpanel.getLabArrRestrains()[i].setIcon((Icon)null);
                }
            }
        } else if (this.type == 2) {
            for(i = 0; i < this.messageJpanel.getLabArrTask().length; ++i) {
                if (i == this.num) {
                    if (this.messageJpanel.getLabArrTask()[i].getIcon() == null) {
                        this.messageJpanel.getLabArrTask()[i].setIcon(CutButtonImage.getImage("skin/8100226/button/B88.png", -1, -1));
                    }
                } else if (this.messageJpanel.getLabArrTask()[i].getIcon() != null) {
                    this.messageJpanel.getLabArrTask()[i].setIcon((Icon)null);
                }
            }
        }

    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
    }

    @Override
    public void mouseExited(MouseEvent e) {
        MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
    }
}
